#ifndef WEB_ACCEPTOR_H
#define WEB_ACCEPTOR_H

#include <boost/shared_ptr.hpp>

#include "../event_handler.h"
#include "../thread_container.h"
#include "../multicaster.h"
#include "../configurator.h"
#include "../singletone.h"

#include "web_handler.h"

namespace handler {
	class web_acceptor : public network::event_handler {
	public:
		web_acceptor(boost::shared_ptr<network::i_socket> sock,
			     boost::shared_ptr<network::i_socket> control,
			     boost::shared_ptr<network::thread_container> con,
			     boost::shared_ptr<network::message_queue> msg,
			     boost::shared_ptr<network::multicaster> mul)
		:_sock(sock), _controller(control), _cont(con), _queue(msg), 
		 _multi(mul) {}
		
		virtual ~web_acceptor() {}

		virtual network::event_type get_type() const
		{
			return network::CONNECT;
		}

		virtual boost::shared_ptr<const network::i_socket>
			get_socket() const {return _sock;}

		virtual void handle_event(
			boost::shared_ptr<network::event> n);
	private:
		boost::shared_ptr<network::i_socket> _sock;
		boost::shared_ptr<network::i_socket> _controller;

		boost::shared_ptr<network::thread_container> _cont;
		boost::shared_ptr<network::message_queue> _queue;
		boost::shared_ptr<network::multicaster> _multi;
	};
}

#endif
